$(function () {
    let form = layui.form
    form.verify({
        pwd: [
            /^[\S]{6,12}$/,
            '密码必须6到12位，且不能出现空格'
        ],
        rePwd: function (value, item) {
            let txt = $('[name=newPwd]').val()
            if (txt !== value) {
                return '两次输入的密码不一致'
            }
        }
    })
    $("#updaInfo").on('submit', function (e) {
        e.preventDefault()
        axios({
            method: 'POST',
            url: '/my/updatepwd',
            data: $(this).serialize()
        }).then(res => {
            if (res.data.status !== 0) {
                return layui.layer.msg(res.data.message)
            }
            layui.layer.msg(res.data.message)
        })
    })
})